const getUserImages = require('./getUserImages/index');
const userLogin = require('./userLogin/index');
const userRegester = require('./userRegester/index');
const userTobeLeader = require('./userTobeLeader/index');
const getGameInfo = require('./getGameInfo/index');
const getGameUsers = require('./getGameInfo/getGameUsers');
const getUserPlayInfo = require('./getGameInfo/getUserPlayInfo');
const addGame = require('./addGame/index');
const addGamePlay = require('./addGame/addGamePlay');
const joinGame = require('./joinGame/index');
const getUserRecord = require('./getGameInfo/getUserRecord');


// 云函数入口函数
exports.main = async (event, context) => {
  switch (event.type) {
    case 'getUserImages':
      return await getUserImages.main(event, context);
    case 'userLogin':
      return await userLogin.main(event, context);
    case 'userRegester':
      return await userRegester.main(event, context);
    case 'userTobeLeader':
      return await userTobeLeader.main(event, context);
    case 'getGameInfo':
      return await getGameInfo.main(event, context);
    case 'getGameUsers':
      return await getGameUsers.main(event, context);
    case 'getUserPlayInfo':
      return await getUserPlayInfo.main(event, context);
    case 'addGame':
      return await addGame.main(event, context);
    case 'joinGame':
      return await joinGame.main(event, context);
    case 'addGamePlay':
      return await addGamePlay.main(event, context);
      case 'getUserRecord':
      return await getUserRecord.main(event, context);
  }
};